-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[keyvault-keys] Browser support, with record and playback #4343
Conversation
"lint:fix": "eslint -c ../../.eslintrc.json src tests samples --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint -c ../../.eslintrc.json src tests samples --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o keyvault-keys-lintReport.html || exit 0", | ||
"lint:fix": "eslint --rule 'no-invalid-this: 0' -c ../../.eslintrc.json src tests samples --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint --rule 'no-invalid-this: 0' -c ../../.eslintrc.json src tests samples --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o keyvault-keys-lintReport.html || exit 0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this rule since I'm using this.title
and other properties of Mocha's test prototypes in my tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like having special lint rules for specific packages. Why is this rule specific to this package? Should the test code for this package instead be modified to align with other packages which don't need this special rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing it!
@@ -161,6 +179,190 @@ class NockRecorder extends Recorder { | |||
} | |||
} | |||
|
|||
class NiseRecorder extends Recorder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is taken as is from storage-queue.
...rowsers/keys_client__create_read_update_and_delete_operations/recording_before_all_hook.json
Outdated
Show resolved
Hide resolved
customLaunchers: { | ||
ChromeHeadlessNoSandbox: { | ||
base: "ChromeHeadless", | ||
flags: ["--no-sandbox", "--disable-web-security"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this flag --no-sandbox
required ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to make it work in my Linux machine without this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same situation for storage-queue for you?
I don't recall facing any such issues with storage packages when I executed the tests on my Ubuntu sometime before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary for me on all libraries that use chrome headless 😅 I believe @daviwil knows an alternative, but I believe it changes the kernel or something.
"exclude": ["node_modules", "types/**", "./samples/**/*.ts", "./test/perf/azure-sb-package/*.ts"], | ||
"include": ["./src/**/*.ts", "./test/**/*.ts"] | ||
"exclude": ["node_modules", "./samples/**/*.ts"], | ||
"include": ["./src/**/*.ts", "./tests/**/*.ts"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NIT]
For consistency, name of the tests folder 📂 tests
-> test
servicebus, template and storage packages follow the name "test".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true! The only caveat is that this PR size will likely increase considerably. Can I change the name of the folder in another PR?
/azp run js - keyvault-keys - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@sadasant: Please do not merge until we get a passing run of pipeline "js - keyvault-keys - tests" (which I manually triggered above). |
5f81d3f
to
e190f77
Compare
} | ||
|
||
public stop(): void { | ||
for (let i = 0; i < this.recordings.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add this for loop to properly filter secret values in this recorder!
/azp run js - keyvault-keys - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
e190f77
to
1bf81e6
Compare
/azp run js - keyvault-keys - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -4,6 +4,7 @@ | |||
|
|||
```ts | |||
|
|||
import { AbortSignalLike } from '@azure/abort-controller'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged a test with abortSignal and I didn't spot the missing definition in the API. I'll address this in all of the other methods in another Pull Request. I made this issue to follow up on this: #4357
"tsconfig.json" | ||
], | ||
"browser": { | ||
"./dist/index.js": "./browser/azure-keyvault-keys.min.js", | ||
"./dist-esm/src/index.js": "./dist-esm/src/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line is a no-op and should be removed. There's no point to map a file to itself.
"lint:fix": "eslint -c ../../.eslintrc.json src tests samples --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint -c ../../.eslintrc.json src tests samples --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o keyvault-keys-lintReport.html || exit 0", | ||
"lint:fix": "eslint --rule 'no-invalid-this: 0' -c ../../.eslintrc.json src tests samples --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint --rule 'no-invalid-this: 0' -c ../../.eslintrc.json src tests samples --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o keyvault-keys-lintReport.html || exit 0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like having special lint rules for specific packages. Why is this rule specific to this package? Should the test code for this package instead be modified to align with other packages which don't need this special rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending comment explaining eslint exclusion and successful live test pass. If you've already seen live tests pass and no significant changes were made since then, you don't need to wait for tests again.
/azp run js - keyvault-keys - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Everything should be working at this point! I'll review myself, clean this and follow up with another PR for keyvault-secrets.
Related to #3797